package com.example.guiguihomemedical.controller;
import com.example.guiguihomemedical.common.Result;
import com.example.guiguihomemedical.entity.Listenerclustering;
import com.example.guiguihomemedical.service.ListenerclusteringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("listenerclustering")
public class ListenerclusteringController {
    @Autowired
    private ListenerclusteringService listenerclusteringService;
    @GetMapping
    public Result getAll(){
        List<Listenerclustering> listenerclusteringList =listenerclusteringService.getAll();
        return Result.success(listenerclusteringList);
    }
    @GetMapping("/{id}")
    public Result getById(@PathVariable Integer id){
        Listenerclustering listenerclustering =listenerclusteringService.getById(id);
        return Result.success(listenerclustering);
    }
}
